//参与有奖类型-活动参与页
exports.activity_info = function (req, res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;

    //最终结果
    var resultData = {};

    //任务流创建
    async.waterfall([
        //1.活动信息查询
        function (cb) {
            R.SEND_HTTP(
                req,
                {
                    url: CORE_APIConfig.coreAPI.search_forum_activity + "/fa_id/"+ restfulParams.fa_id,
                    method: 'POST',
                    data: {
                        fields: ["fa_title", "fa_content", "fa_end_time", "fa_collect_count", "fa_comment_count", "fa_browse_count", "fa_share_count", "fa_join_count", "fa_create_time"].join(",")
                    }
                },
                function (err, data) {
                    //判断是否有错误信息
                    if (err) {
                        return cb(err, data);
                    }

                    resultData.forumActivityData = data.data;
                    cb();
                }
            );

        },
        //2.评论与回复
        function (cb) {
            R.SEND_HTTP(
                req,
                {
                    url: CORE_APIConfig.coreAPI.search_forum_activity_comment + "/fac_faid/"+ restfulParams.fa_id,
                    method: 'POST',
                    data: {
                        fields: ["u_nickname", "u_header_url", "fac_uid", "fac_content", "fac_is_reply", "fac_zan_count", "fac_is_author_commnet", "fac_create_time", "fac_reply_uid"].join(",")
                    }
                },
                function (err, data) {
                    //判断是否有错误信息
                    if (err) {
                        return cb(err, data);
                    }

                    resultData.activityCommentData = data.data;
                    cb();
                }
            );

        },
        function (cb) {
            R.SEND_HTTP(
                req,
                {
                    url: CORE_APIConfig.coreAPI.search_forum_activity_join_user,
                    method: 'POST',
                    data: {
                        fields: ["u_nickname", "u_header_url"].join(",")
                    }
                },
                function (err, data) {
                    //判断是否有错误信息
                    if (err) {
                        return cb(err, data);
                    }

                    resultData.actionData = data.data;
                    cb();
                }
            );

        },

        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true, resultData);

        }
    );

}